import Vue from 'vue';
import Vuex from 'vuex';
import getters from  "./getters"
Vue.use(Vuex);

let modules = {};

const requireAllModules = require.context('./modules', true, /\.js$/);

requireAllModules.keys().forEach((key) => {
  let module = requireAllModules(key).default;
  if (module && module.name && module.namespaced) {
    modules[module.name] = module;
  }
});

export default new Vuex.Store({

  modules: modules,
  getters:getters,
  strict: process.env.NODE_ENV !== 'production',
});
